

import ApiClient from '../client.js';
import { API_CONFIG, API_ENDPOINTS } from '../config.js';
import { createModuleAdapter } from '../adapters/api-adapter.js';

class CustomerApiService {
    constructor() {
        this.client = new ApiClient();
        this.client.baseURL = API_CONFIG?.CUSTOMER?.BASE_URL|| API_CONFIG.BASE_URL;
    }

    /**
     * 获取客户列表
     */
    async getList(params) {
        return await this.client.get(API_ENDPOINTS.CUSTOMERS.LIST, {
          query: params,
        });
    }
}

// 创建适配器实例
// 文档管理适配器
const customerAdapter = createModuleAdapter(
    'CUSTOMER',
    null,  // 使用 Mock 服务对象
    new CustomerApiService()
);


export const customerService = {
    async getList(params) {
        return customerAdapter.get('getList', params);
    }
}